home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / bison.zip / BISON.DIF < prev    next >
Text File  |  1989-02-03  |  8KB  |  298 lines

  1. diff -c /usr/pkg/gnu/src/bison/files.c ./files.c
  2. *** /usr/pkg/gnu/src/bison/files.c    Wed Jul  6 08:41:01 1988
  3. --- ./files.c    Wed Jan  4 11:46:16 1989
  4. ***************
  5. *** 30,35 ****
  6. --- 30,39 ----
  7.   #include "new.h"
  8.   #include "gram.h"
  9.   
  10. + #ifdef __STDC__
  11. + void *malloc(unsigned);
  12. + #endif
  13.   FILE *finput = NULL;
  14.   FILE *foutput = NULL;
  15.   FILE *fdefines = NULL;
  16. ***************
  17. *** 54,59 ****
  18. --- 58,64 ----
  19.   
  20.   char    *mktemp();    /* So the compiler won't complain */
  21.   FILE    *tryopen();    /* This might be a good idea */
  22. + char    *getenv();
  23.   
  24.   extern int verboseflag;
  25.   extern int definesflag;
  26. ***************
  27. *** 100,109 ****
  28.   #ifdef VMS
  29.     char *tmp_base = "sys$scratch:b_";
  30.   #else
  31.     char *tmp_base = "/tmp/b.";
  32.   #endif
  33. !   int tmp_len = strlen (tmp_base);
  34.   
  35.     if (spec_outfile)
  36.       {
  37.         /* -o was specified.  The precise -o name will be used for ftable.
  38. --- 105,126 ----
  39.   #ifdef VMS
  40.     char *tmp_base = "sys$scratch:b_";
  41.   #else
  42. + #  ifdef MSC5
  43. +   char *tmp_base;
  44. + #  else
  45.     char *tmp_base = "/tmp/b.";
  46. + #  endif
  47. + #endif
  48. +   int tmp_len;
  49. + #ifdef MSC5
  50. +   if ((tmp_base = getenv("TMP")) == NULL) tmp_base="";
  51.   #endif
  52. !   tmp_len = strlen (tmp_base);
  53.   
  54. + #ifdef MSC5
  55. +       strlwr(infile);
  56. + #endif
  57.     if (spec_outfile)
  58.       {
  59.         /* -o was specified.  The precise -o name will be used for ftable.
  60. ***************
  61. *** 111,116 ****
  62. --- 128,136 ----
  63.         name_base = spec_outfile;
  64.         /* BASE_LENGTH includes ".tab" but not ".c".  */
  65.         base_length = strlen (name_base);
  66. + #ifdef MSC5
  67. +       strlwr(name_base);
  68. + #endif
  69.         if (!strcmp (name_base + base_length - 2, ".c"))
  70.       base_length -= 2;
  71.         /* SHORT_BASE_LENGTH includes neither ".tab" nor ".c".  */
  72. ***************
  73. *** 144,150 ****
  74.       base_length -= 2;
  75.         short_base_length = base_length;
  76.   
  77. ! #ifdef VMS
  78.         name_base = stringappend(name_base, short_base_length, "_tab");
  79.   #else
  80.         name_base = stringappend(name_base, short_base_length, ".tab");
  81. --- 164,170 ----
  82.       base_length -= 2;
  83.         short_base_length = base_length;
  84.   
  85. ! #if defined(VMS) || defined(MSC5)
  86.         name_base = stringappend(name_base, short_base_length, "_tab");
  87.   #else
  88.         name_base = stringappend(name_base, short_base_length, ".tab");
  89. ***************
  90. *** 154,165 ****
  91.   
  92.     finput = tryopen(infile, "r");
  93.   
  94. !   filename = (char *) getenv ("BISON_SIMPLE");
  95. !   fparser = tryopen(filename ? filename : PFILE, "r");
  96.   
  97.     if (verboseflag)
  98.       {
  99.         outfile = stringappend(name_base, short_base_length, ".output");
  100.         foutput = tryopen(outfile, "w");
  101.       }
  102.   
  103. --- 174,201 ----
  104.   
  105.     finput = tryopen(infile, "r");
  106.   
  107. !   if(!(filename = (char *) getenv ("BISON_SIMPLE")))
  108. ! #ifdef MSC5    /* file doesn't exist in curent directory, try in INIT directory */
  109. !         if(access(PFILE,4) && (cp = getenv("INIT"))) {
  110. !                 filename = malloc(strlen(cp)+strlen(PFILE)+2);
  111. !                 strcpy(filename,cp);
  112. !                 cp = filename+strlen(filename);
  113. !                 *cp++ = '/';
  114. !                 strcpy(cp,PFILE);
  115. !         }
  116. !         else
  117. ! #endif
  118. !       filename = PFILE;
  119. !   fparser = tryopen(filename, "r");
  120.   
  121.     if (verboseflag)
  122.       {
  123. + #ifdef MSC5
  124. +       outfile = stringappend(name_base, short_base_length, ".out");
  125. + #else
  126.         outfile = stringappend(name_base, short_base_length, ".output");
  127. + #endif
  128.         foutput = tryopen(outfile, "w");
  129.       }
  130.   
  131. ***************
  132. *** 169,185 ****
  133. --- 205,239 ----
  134.         fdefines = tryopen(defsfile, "w");
  135.       }
  136.   
  137. + #ifdef MSC5
  138. +   actfile = mktemp(stringappend(tmp_base, tmp_len, "acXXXXXX"));
  139. + #else
  140.     actfile = mktemp(stringappend(tmp_base, tmp_len, "act.XXXXXX"));
  141. + #endif
  142.     faction = tryopen(actfile, "w+");
  143. + #ifndef MSC5
  144.     unlink(actfile);
  145. + #endif
  146.   
  147. + #ifdef MSC5
  148. +   tmpattrsfile = mktemp(stringappend(tmp_base, tmp_len, "atXXXXXX"));
  149. + #else
  150.     tmpattrsfile = mktemp(stringappend(tmp_base, tmp_len, "attrs.XXXXXX"));
  151. + #endif
  152.     fattrs = tryopen(tmpattrsfile,"w+");
  153. + #ifndef MSC5
  154.     unlink(tmpattrsfile);
  155. + #endif
  156.   
  157. + #ifdef MSC5
  158. +   tmptabfile = mktemp(stringappend(tmp_base, tmp_len, "taXXXXXX"));
  159. + #else
  160.     tmptabfile = mktemp(stringappend(tmp_base, tmp_len, "tab.XXXXXX"));
  161. + #endif
  162.     ftable = tryopen(tmptabfile, "w+");
  163. + #ifndef MSC5
  164.     unlink(tmptabfile);
  165. + #endif
  166.   
  167.       /* These are opened by `done' or `open_extra_files', if at all */
  168.     if (spec_outfile)
  169. ***************
  170. *** 191,198 ****
  171. --- 245,257 ----
  172.     attrsfile = stringappend(name_base, short_base_length, "_stype.h");
  173.     guardfile = stringappend(name_base, short_base_length, "_guard.c");
  174.   #else
  175. + #  ifdef MSC5
  176. +   attrsfile = stringappend(name_base, short_base_length, ".sth");
  177. +   guardfile = stringappend(name_base, short_base_length, ".guc");
  178. + #  else
  179.     attrsfile = stringappend(name_base, short_base_length, ".stype.h");
  180.     guardfile = stringappend(name_base, short_base_length, ".guard.c");
  181. + #  endif
  182.   #endif
  183.   }
  184.   
  185. ***************
  186. *** 204,214 ****
  187.   {
  188.     FILE *ftmp;
  189.     int c;
  190. !   char *filename;
  191.           /* JF change open parser file */
  192.     fclose(fparser);
  193.     filename = (char *) getenv ("BISON_HAIRY");
  194. !   fparser= tryopen(filename ? filename : PFILE1, "r");
  195.   
  196.           /* JF change from inline attrs file to separate one */
  197.     ftmp = tryopen(attrsfile, "w");
  198. --- 263,284 ----
  199.   {
  200.     FILE *ftmp;
  201.     int c;
  202. !   char *filename, *cp;
  203.           /* JF change open parser file */
  204.     fclose(fparser);
  205.     filename = (char *) getenv ("BISON_HAIRY");
  206. ! #ifdef MSC5    /* file doesn't exist in curent directory, try in INIT directory */
  207. !         if(access(PFILE1,4) && (cp = getenv("INIT"))) {
  208. !                 filename = malloc(strlen(cp)+strlen(PFILE)+2);
  209. !                 strcpy(filename,cp);
  210. !                 cp = filename+strlen(filename);
  211. !                 *cp++ = '/';
  212. !                 strcpy(cp,PFILE1);
  213. !         }
  214. !         else
  215. ! #endif
  216. !       filename = PFILE1;
  217. !   fparser= tryopen(filename, "r");
  218.   
  219.           /* JF change from inline attrs file to separate one */
  220.     ftmp = tryopen(attrsfile, "w");
  221. ***************
  222. *** 283,288 ****
  223. --- 353,365 ----
  224.     if (k==0) sys$exit(SS$_NORMAL);
  225.     sys$exit(SS$_ABORT);
  226.   #else
  227. + #  ifdef MSC5
  228. +   if (actfile) unlink(actfile);
  229. +   if (tmpattrsfile) unlink(tmpattrsfile);
  230. +   if (tmptabfile) unlink(tmptabfile);
  231. +   exit(k);
  232. + #  else
  233.     exit(k);
  234. + #  endif
  235.   #endif
  236.   }
  237. diff -c /usr/pkg/gnu/src/bison/machine.h ./machine.h
  238. *** /usr/pkg/gnu/src/bison/machine.h    Fri Dec 19 17:38:40 1986
  239. --- ./machine.h    Sat Dec 31 20:35:34 1988
  240. ***************
  241. *** 21,26 ****
  242. --- 21,32 ----
  243.   #define    MAXSHORT    32767
  244.   #define    MINSHORT    -32768
  245.   
  246. + #ifdef MSC5
  247. + #define    BITS_PER_WORD    16
  248. + #define    WORDSIZE(n)    (((n) + 15) / 16)
  249. + #define    SETBIT(x, i)    ((x)[(i)>>4] |= (1<<((i) & 15)))
  250. + #else
  251.   #define    BITS_PER_WORD    32
  252.   #define    WORDSIZE(n)    (((n) + 31) / 32)
  253.   #define    SETBIT(x, i)    ((x)[(i)>>5] |= (1<<((i) & 31)))
  254. + #endif
  255. diff -c /usr/pkg/gnu/src/bison/output.c ./output.c
  256. *** /usr/pkg/gnu/src/bison/output.c    Wed Oct 12 05:06:23 1988
  257. --- ./output.c    Sat Dec 31 20:35:18 1988
  258. ***************
  259. *** 103,110 ****
  260.   #include "gram.h"
  261.   #include "state.h"
  262.   
  263.   #define    MAXTABLE 32767
  264.   
  265.   extern int debugflag;
  266.   extern int nolinesflag;
  267. --- 103,113 ----
  268.   #include "gram.h"
  269.   #include "state.h"
  270.   
  271. + #ifdef MSC5
  272. + #define    MAXTABLE 16383
  273. + #else
  274.   #define    MAXTABLE 32767
  275. ! #endif
  276.   
  277.   extern int debugflag;
  278.   extern int nolinesflag;
  279. *** /usr/pkg/gnu/src/bison/bison.simple    Sun Jan 29 13:40:33 1989
  280. --- ./bison.simple    Sun Jan 29 13:43:05 1989
  281. ***************
  282. *** 113,118 ****
  283. --- 113,122 ----
  284.      It is replaced by the list of actions, each action
  285.      as one case of the switch.  */
  286.   
  287. + #ifndef BSD
  288. + #define bcopy(s,d,l) memcpy(d,s,l)
  289. + #endif
  290.   #define yyerrok        (yyerrstatus = 0)
  291.   #define yyclearin    (yychar = YYEMPTY)
  292.   #define YYEMPTY        -2
  293.